from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Integer

Base = declarative_base()


class Item(Base):
    __tablename__ = "shfe"
    ID = Column(Integer, nullable=False, primary_key=True, autoincrement=True)
    PRODUCT_ID = Column(String(32), nullable=False, comment="ID")
    PRODUCT_NAME = Column(String(64), nullable=False, comment="产品名称")
    PRODUCT_MONTH = Column(String(64), nullable=False, comment="交割月份")
    PRE_SETTLEMENT_PRICE = Column(Integer, comment="前结算")
    OPEN_PRICE = Column(Integer, comment="今开盘")
    HIGHEST_PRICE = Column(Integer, comment="最高价")
    LOWEST_PRICE = Column(Integer, comment="最低价")
    CLOSE_PRICE = Column(Integer, comment="收盘价")
    SETTLEMENT_PRICE = Column(Integer, comment="结算参考价")
    ZD1_CHG = Column(Integer, comment="涨跌1")
    ZD2_CHG = Column(Integer, comment="涨跌2")
    VOLUME = Column(Integer, comment="成交手")
    TURNOVER = Column(Integer, comment="成交额")
    OPEN_INTEREST = Column(Integer, comment="持仓手")
    OPEN_INTEREST_CHG = Column(Integer, comment="变化")

